package main

import "fmt"

// 父结构体
type NongFuShanQuan struct {
	name string
}

func (a NongFuShanQuan) run() {
	fmt.Printf("%s is run\n", a.name)
}

// 结构体嵌套 继承
type Cat struct {
	Age int8
	NongFuShanQuan
}

func (d Cat) miaomiao() {
	fmt.Printf("%s 会 喵喵叫\n", d.name)
}
func main() {
	littleCat := Cat{
		Age: 4,
		NongFuShanQuan: NongFuShanQuan{
			name: "小仔仔",
		},
	}
	littleCat.miaomiao()
}
